#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDialog>


MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    //点击之后打开一个窗口
//    QDialog* dialog = new QDialog();
//    dialog->resize(1000,300);
//    dialog->show();
//    dialog->setAttribute(Qt::WA_DeleteOnClose);
    mydialog* dialog = new mydialog(this);
    dialog->resize(400,400);
    dialog->show();
    dialog->setAttribute(Qt::WA_DeleteOnClose);
}

void MainWindow::on_pushButton_2_clicked()
{
    Dialog* dig = new Dialog(this);
    dig->exec();
    dig->setAttribute(Qt::WA_DeleteOnClose);
}
